﻿<UserControl x:Class="P2.Cuberry.Modules.RealEstate.REPlot.REPlotsListView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:P2.Cuberry.Modules.RealEstate.REPlot"    
             Unloaded="UserControl_Unloaded">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/Styles.xaml"/>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/CuberryDataGrid.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    
    <Grid VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" MinHeight="44" />            
 
        </Grid.RowDefinitions>

        <DataGrid Grid.Row ="0" ItemsSource="{Binding}" 
                     Name="REPlotsList"
                     SelectionChanged="REPlotsList_SelectionChanged" 
                     MouseDoubleClick="REPlotsList_DblClick" 
                     Style="{DynamicResource CuberryDataGridStyle}"
                     VerticalAlignment="Stretch" >
            
            <DataGrid.Columns>
                <DataGridTextColumn Header="{Translate PlotNoL}" Binding="{Binding Path=PlotNo}" MinWidth="25" Width="100" />
                <DataGridTextColumn Header="{Translate PlotPriceL}" Binding="{Binding Path=PlotPrice, StringFormat=N2}" MinWidth="25" Width="100" CellStyle="{StaticResource AlwaysRightAlignedCellStyle}"/>
                <DataGridTextColumn Header="{Translate PlotCircumferenceL}" Binding="{Binding Path=PlotCircumference, StringFormat=N2}" MinWidth="25" Width="100" CellStyle="{StaticResource AlwaysRightAlignedCellStyle}"/>
                <DataGridTextColumn Header="{Translate PlotAreaL}" Binding="{Binding Path=PlotArea, StringFormat=N2}" MinWidth="25" Width="120" CellStyle="{StaticResource AlwaysRightAlignedCellStyle}"/>
                <DataGridTextColumn Header="{Translate PlotLengthL}" Binding="{Binding Path=PlotLength, StringFormat=N2}" MinWidth="25" Width="120" CellStyle="{StaticResource AlwaysRightAlignedCellStyle}"/>
                <DataGridTextColumn Header="{Translate PlotWidthL}" Binding="{Binding Path=PlotWidth, StringFormat=N2}" MinWidth="25" Width="120" CellStyle="{StaticResource AlwaysRightAlignedCellStyle}"/>                
                
                <DataGridTextColumn Header="{Translate PlotCategoryIDL}" Binding="{Binding Path=PlotCategoryName}" MinWidth="25" Width="120" />                                
                <DataGridTextColumn Header="{Translate StatusNameL}" Binding="{Binding Path=StatusName, Mode=OneWay}" MinWidth="40" Width="*" IsReadOnly="True" />
                

            </DataGrid.Columns>
        </DataGrid>
    
</Grid>
</UserControl>
